import request from '@/api/myRequest'
// 获取订单列表
function findOrdersByPage(start, limit, data) {
  return request({
    url: `/lejuAdmin/order/findOrdersByPage/${start}/${limit}`,
    method: 'POST',
    data
  })
}
// 关闭订单
function finishOrder(orderId) {
  return request({
    url: `/lejuAdmin/order/finishOrder/${orderId}`,
    method: 'POST'
  })
}
// 查看订单明细
function orderDetail(orderId) {
  return request({
    url: `/lejuAdmin/order/orderDetail/${orderId}`,
    method: 'GET'
  })
}
// 强制确认收货
function receiveProductsForce(orderId, data) {
  return request({
    url: `/lejuAdmin/order/receiveProductsForce/${orderId}`,
    method: 'POST'
  })
}
// 确认发货

function sendDone(data) {
  return request({
    url: `/lejuAdmin/order/sendDone`,
    method: 'POST',
    data
  })
}
// 退货列表
function findReturnApply(start, limit, data) {
  return request({
    url: `/lejuAdmin/orderReturn/findReturnApply/${start}/${limit}`,
    method: 'POST',
    data
  })
}
// 同意退货
function agreeApply(id, data) {
  return request({
    url: `/lejuAdmin/orderReturn/agreeApply/${id}`,
    method: 'POST',
    data
  })
}
// 拒绝退货
function rejectApply(id, data) {
  return request({
    url: `/lejuAdmin/orderReturn/rejectApply/${id}`,
    method: 'POST',
    data
  })
}
// 收到退货
function receiveProduct(id) {
  return request({
    url: `/lejuAdmin/orderReturn/receiveProduct/${id}`,
    method: 'POST'
  })
}
// 添加地址
function save(data) {
  return request({
    url: `/lejuAdmin/companyAddress/save`,
    method: 'POST',
    data
  })
}
// 修改地址
function update(data) {
  return request({
    url: `/lejuAdmin/companyAddress/update`,
    method: 'POST',
    data
  })
}
// 查看退单明细
function orderReturn(id) {
  return request({
    url: `/lejuAdmin/orderReturn/${id}`,
    method: 'GET'
  })
}
// 地址列表
function addressList() {
  return request({
    url: `/lejuAdmin/companyAddress/addressList`,
    method: 'GET'
  })
}
// 删除地址
function delcompanyAddress(id) {
  return request({
    url: `/lejuAdmin/companyAddress/${id}`,
    method: 'DELETE'
  })
}
// 修改收货默认
function setReceiveOne(data) {
  return request({
    url: `/lejuAdmin/companyAddress/setReceiveOne`,
    method: 'POST',
    data
  })
}
// 修改发货默认
function setSendOne(data) {
  return request({
    url: `/lejuAdmin/companyAddress/setSendOne`,
    method: 'POST',
    data
  })
}
// 去人收货
function addreceiveProduct(id, data) {
  return request({
    url: `/lejuAdmin/orderReturn/receiveProduct/${id}`,
    method: 'POST',
    data
  })
}
export {
  findOrdersByPage, finishOrder, orderDetail, receiveProductsForce, sendDone, findReturnApply, agreeApply, rejectApply
  , receiveProduct, orderReturn, addressList, delcompanyAddress, save, update, setReceiveOne, setSendOne, addreceiveProduct
}

